#ifndef EDITOR_MOUSE_HANDLER_H
#define EDITOR_MOUSE_HANDLER_H

struct SEditorMouseHandler
{
    virtual void Update( );
    virtual void Do( ) = 0;
    virtual void Undo( ) = 0;
    virtual void Redo( ) = 0;
    virtual void Cancel( ) = 0;
    IPoint mousepos;
    static void SetCurHandler( SEditorMouseHandler *handler );
};

extern SEditorMouseHandler *g_pEditorMouseHandler;

struct SGrid
{
    int x;
    int y;
    char type;
};

struct STerrainHandler:public SEditorMouseHandler
{
    typedef std::vector<SGrid> Grids;
    STerrainHandler( );
    void Update( );
    virtual void Do( );
    virtual void Undo( );
    virtual void Redo( );
    virtual void Cancel( );
    void SetBack( );
    void GetTerrain( );

    Grids m_grids;
    int m_size;
    int m_terrain;
};

extern STerrainHandler g_terrainhandler;

class sgEntity;

struct SEntityHandler:public SEditorMouseHandler
{
    enum
    {
        army,
        city,
    };
    SEntityHandler( );
    void Update( );
    void SetEntity( sgEntity *e );
    virtual void Do( );
    virtual void Undo( );
    virtual void Redo( );
    virtual void Cancel( );
    sgEntity *curEntity;
    int entityType;
};

extern SEntityHandler g_entityhandler;
#endif